Skip to content

fix(mcpx): bound sdnotify socket sends - #6176

Merged
dezren39 merged 2 commits into
mainfrom
queue/9439-5428-sdnotify-abstract-socket
Nov 13, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/9439-5428-sdnotify-abstract-socket

Conversation

@dezren39

@dezren39 dezren39 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #5428. Bound sdnotify.Send dial and write operations to one second, so an unresponsive notify socket cannot stall the test suite indefinitely. The abstract-socket test skips only for Linux abstract-socket unavailability or timeout; it still verifies READY=1 on hosts where abstract datagrams work. Added bounded-dial/write and unsupported-error classification tests.

-Send
-  DialUnix + Write with no deadline
+Send
+  context-bounded unixgram dial
+  write deadline
+TestAbstractSocketName
+  keep Linux positive coverage
+  skip only when abstract sockets are unavailable

Evidence

  • Before: local baseline TestAbstractSocketName passed; reported fleet-build run 41819578987 hung in Ready/Send for 1800.070s.
    After: go test ./internal/sdnotify -count=1 -timeout=30s, go test ./internal/sdnotify -race -shuffle=on -count=5 -timeout=60s, and go vet ./internal/sdnotify pass locally. The abstract-socket hang has not been reproduced outside the fleet-build environment.

Merge Danger

Door: two-way

Blast Radius: narrow

Only mcpx systemd notification socket operations and their tests change; socket path, payload, and caller behavior are unchanged except for bounded errors.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 5, 2026 09:21
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8bae0a17-5432-43ba-a2a3-2bd57e2524a1
Commits

Reviewing files that changed from the base of the PR and between 6741fc5 and 9e64917.

Files selected for processing: 2

  • pkgs/mcpx/internal/sdnotify/sdnotify.go
  • pkgs/mcpx/internal/sdnotify/sdnotify_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T18:54:18.886336Z 9e64917 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ce9151f6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +184 to +185
if conn.writeDeadline.Before(started) || conn.writeDeadline.After(started.Add(timeout+time.Millisecond)) {
t.Fatalf("write deadline = %s, want it within %s of send start", conn.writeDeadline, timeout)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the one-millisecond scheduling assumption from the deadline test

On a loaded CI worker, a scheduling pause of more than one millisecond between recording started and setting the write deadline makes this assertion fail even when sendWithDialer behaves correctly: the implementation computes its deadline from the time after dialing, not from started. This introduces a flaky failure into the suite this change is intended to stabilize. Capture timestamps around the call and check that the recorded deadline falls within those bounds plus timeout, rather than assuming setup finishes within one millisecond. The scoped testing guidance requires fixing or explicitly quarantining flakes.

AGENTS.md reference: pkgs/mcpx/internal/AGENTS.md:L13-L14

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9e64917 (task 14033, lane any-d): TestSendWriteHasDeadline now captures finished after the call and asserts the deadline falls in [started+timeout, finished+timeout], so no fixed 1ms scheduling assumption remains. Verified: go test ./internal/sdnotify/ -count=1 passes and the two deadline tests pass at -count=50.

@dezren39

Copy link
Copy Markdown
Member Author

Picked up — task 14033, shepherd PR #6176

Lane any-d claimed task 14033. Fresh verification: PR #6176 is OPEN, head 7ce9151, no labels (no held / user/owned / do-not-merge / do-not-auto-edit). The fix is not on main (main still dials unbounded). One Codex P2 finding is open: the write-deadline test in sdnotify_test.go assumes setup finishes within 1ms and can flake on a loaded worker.

Plan: rebase the single commit onto current main in worktree ~/git/fleet/queue-14033-6176-sdnotify, fix the Codex finding by bounding the deadline assertion with timestamps captured around the call, run the sdnotify package tests, push to the PR branch, and merge when verified.

@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 12, 2026
@dezren39
dezren39 force-pushed the queue/9439-5428-sdnotify-abstract-socket branch from 7ce9151 to 9e64917 Compare November 12, 2026 18:52
@dezren39

Copy link
Copy Markdown
Member Author

Parked (CI wait) — task 14033, PR #6176

Lane any-d shepherded PR #6176: rebased its single commit onto current main (6741fc5) resolving the sdnotify.go close-form conflict, fixed the open Codex P2 finding (write-deadline test no longer assumes 1ms scheduling slack; assertion bounded by timestamps captured around the call — reply posted on the Codex thread), and pushed head 9e64917.

Local verification: go test ./internal/sdnotify/ -count=1 passes (all 8 tests), deadline tests pass at -count=50, go vet and gofmt clean.

CI at park time: relevant checks PASS (mcpx-test lint, mcpx-test plugin-ts, mcpx-test init, mcpx fix carries a test, mcpx affected-embed regressions, spec parity, production line limit, proxy fallbacks). Still PENDING: mcpx-test unit + e2e shards, nix build, stress PR changed tests. FAILING in areas this PR does not touch (diff is only pkgs/mcpx/internal/sdnotify/*.go; the branch is current main plus those two commits): aggregator/projector python suites (claimant install .bun write), fleet-search parity, basic lint, plugin sync check.

Parking task 14033 as a CI wait on PR #6176. Resume: when the pending mcpx/nix checks complete, merge PR #6176 if the pending checks pass or fail only as they do on main, then complete task 14033 as fixed_merged and close the loop on issue #5428 if it applies. Worktree: ~/git/fleet/queue-14033-6176-sdnotify (branch queue/14033-6176-sdnotify-work, head 9e64917).

@dezren39 dezren39 added queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition and removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Nov 12, 2026
@dezren39
dezren39 merged commit 93707be into main Nov 13, 2026
29 of 39 checks passed
@dezren39
dezren39 deleted the queue/9439-5428-sdnotify-abstract-socket branch November 13, 2026 10:22
@dezren39

Copy link
Copy Markdown
Member Author

Shepherded to merge (task 14033, lane any-b, 2026-11-13).

  • Fresh verification: PR merges cleanly against current main (git merge-tree exit 0), no hard-stop labels. The change bounds sdnotify sends with a 1 s timeout (DialContext + write deadline) and hardens the abstract-socket tests.
  • Tests: go test ./internal/sdnotify/ at head 9e649178f1 — ok.
  • Reviews: Codex review completed at the current head with no findings (the earlier P2 on the write-deadline test assertion was fixed in 9e649178f1 under this same task). CodeRabbit skipped.
  • Merged (squash): 93707befa7e20adeb165d7c9b2b32819ec3aecd2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main CI failure: org-run (generic dispatch runner) (run 41819578987)

1 participant